The usage of widgets on web pages provides publishers with a convenient and efficient way to incorporate additional features into the web pages. For example, a publisher can easily include a weather notification on a web page by embedding a weather widget on the web page. Because a widget may be included in numerous different web pages and each web page may includes hundreds of different widgets, it is very difficult to monitor each widget hosted on a tremendous number of web pages and to prevent any widget misbehavior and unintended interactions between the web pages and the widget.
The widget misbehavior may cause many severe problems. For example, the widget misbehavior may cause a catastrophic self-denial-of-servicing (self-DoSing) behavior leading to a complete service outage. The widget misbehavior may also cause other problems such as stealing keyboard focus from the web page hosting the widget, leaking code errors to interrupt application in the web page, frame busting causing infinite redirections of the web page or the widget, excessive error reports, inappropriately displaying the widget even when the widget is inactive, triggering excessive client-side connections that slow down the web page, triggering new pop-up windows and leaking global symbols to the web page, etc.
It is expensive and time consuming to monitor and detect every widget misbehavior because of the large quantity of widgets used in numerous web pages. Therefore, it is desirable to establish a framework that automatically prevents widget misbehavior, detects errors associated with widgets and minimizes problems incurred by misbehaving widgets.